<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<script>
    var socket = new WebSocket("ws://0.0.0.0:81/websocket");

    socket.onopen = function () {
        console.log("WebSocket连接已建立");
    };

    socket.onmessage = function (event) {
        console.log("收到消息：" + event.data);
    };

    socket.onclose = function (event) {
        console.log("WebSocket连接已关闭");
    };
</script>
<body>

<form>

    <button onclick="socket.send()">
        <button type="submit">提交</button>
    </button>

</form>

</body>
</html>